# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregation do
  @moduledoc """
  Usage data aggregation for a single day.

  ## Attributes

  *   `cpu` (*type:* `GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationCPU.t`, *default:* `nil`) - CPU usage.
  *   `date` (*type:* `GoogleApi.MigrationCenter.V1.Model.Date.t`, *default:* `nil`) - Aggregation date. Day boundaries are at midnight UTC.
  *   `disk` (*type:* `GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationDisk.t`, *default:* `nil`) - Disk usage.
  *   `memory` (*type:* `GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationMemory.t`, *default:* `nil`) - Memory usage.
  *   `network` (*type:* `GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationNetwork.t`, *default:* `nil`) - Network usage.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cpu => GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationCPU.t() | nil,
          :date => GoogleApi.MigrationCenter.V1.Model.Date.t() | nil,
          :disk => GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationDisk.t() | nil,
          :memory =>
            GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationMemory.t() | nil,
          :network =>
            GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationNetwork.t() | nil
        }

  field(:cpu, as: GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationCPU)
  field(:date, as: GoogleApi.MigrationCenter.V1.Model.Date)
  field(:disk, as: GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationDisk)
  field(:memory, as: GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationMemory)
  field(:network, as: GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregationNetwork)
end

defimpl Poison.Decoder, for: GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregation do
  def decode(value, options) do
    GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregation.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MigrationCenter.V1.Model.DailyResourceUsageAggregation do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
